#include"ChatList.h"

bool ChatList::add_chat(const string& chat_id,const string& state){
    this->chat_list_json["LIST"][chat_id]=state;
    return true;
}
bool ChatList::remove_chat(const string& chat_id){
    this->chat_list_json["LIST"].erase(chat_id);
    return true;
}

bool ChatList::update_chat_state(const string& chat_id, const string& state){
    this->chat_list_json["LIST"][chat_id]=state;
    return true;
}

json& ChatList::get_chat_list_json(){
    return this->chat_list_json;
}

json ChatList::serialize()const {
    return this->chat_list_json;
}

void ChatList::unserialize(const json& j) {
    this->chat_list_json=j;
}